[YouTube] PoToken implementation with HtmlUnit#12027
[YouTube] PoToken implementation with HtmlUnit#12027Stypox wants to merge 3 commits intoTeamNewPipe:devfrom
Conversation
HtmlUnit is a Java library that simulates a very basic browser environment and executes JavaScript using Gecko
|
It seems the solution to the build issue is to disable Instant Run. |
|
What is the benefit of using HtmlUnit compared to the WebView? |
|
HtmlUnit would be a platform-independent solution that does not rely on the system webview. It could be an alternative for those phones where the WebView implementation is broken or results in invalid poTokens. However, this is mostly an experimental PR, since there are a few problems highlighted above with no clear solution, plus the HtmlUnit library would increase the APK size. |
|
The system webview is updatable starting with Android 5.0, so this PR might not be necessary. |
|
That is true in theory, but we all know device manufacturers tend to mess with default Android components more than they should... But yeah this might not be worth it. |
The WebView by Google is now Android 8.0+, so other devices are stuck with old WebViews and websites may break on them sooner or later. |
In that case, it might be a good idea to bump the app's minimum SDK version to 26. |
Personally I'm strongly against it, specially for this app. |
|
@Stypox |
|
@ale5000-git yes that would be a good idea |
|
Closing for now, this was more of a (kind-of-successful) proof-of-concept |
What is it?
Description of the changes in your PR
This is an experimental PR that aims to provide an alternative
PoTokenProviderimplementation that does not rely on the system WebView. HtmlUnit is apparently able to simulate a browser well enough, and the generated poTokens work, however there are a couple of problems:minSdkis increased to26due to this issue. The APK built by this PR hasminSdkincreased to26for testing purposes, but this is obviously not the solution.minifyEnabledseems to create issues for release builds.APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Release APK built at commit 768db9f with
minifyEnabled=false(otherwise it wouldn't build); it might be faster than the debug version: app-release.zipDue diligence